using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
using WozLib.UI.Ink;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Shapes;
using WozLib.UI.Ink.SketchObjects;

namespace WozLib.UI.Ink.SketchCommands
{
  [XmlInclude(typeof(LinkActionSketchCommand))]
  [XmlInclude(typeof(UserButtonActionSketchCommand))]
  [XmlInclude(typeof(UserActionSketchCommand))]
  [XmlInclude(typeof(ReplacementSketchCommand))]
  [XmlInclude(typeof(HideHourglassSketchCommand))]
  [XmlInclude(typeof(ShowHourglassSketchCommand))]
  [XmlInclude(typeof(ModifyUserToolsEnabledCollection))]
  [XmlInclude(typeof(ModifyUserCurrentInkTool))]
  [XmlInclude(typeof(ClickSketchCommand))]
  [XmlInclude(typeof(MoveBackwardSketchCommand))]
  [XmlInclude(typeof(MoveForewardSketchCommand))]
  [XmlInclude(typeof(PlayAudioSketchCommand))]
  [XmlInclude(typeof(SpeekSketchCommand))]
  [XmlInclude(typeof(ClearSketchCommand))]
  [XmlInclude(typeof(EraseSketchCommand))]
  [XmlInclude(typeof(ChangeSelectionSketchCommand))]
  [XmlInclude(typeof(ModifyObjectSketchCommand))]
  [XmlInclude(typeof(MouseMoveSketchCommand))]
  [XmlInclude(typeof(WindowResizeWozCommand))]
  [XmlInclude(typeof(CreateSketchCommand))]
  [XmlInclude(typeof(WindowRenameSketchCommand))]
  public class SketchCommand
  {
    // Static stuff
    // eventually we'll actually need to make this instance stuff for another class
    // and pass a link to that class to command that gets created

    [XmlIgnore]
    public SketchCommandReferences WozClientCommandReferences
    {
      get
      {
        return _WozClientCommandReferences;
      }
      set
      {
        _WozClientCommandReferences = value;
      }
    } SketchCommandReferences _WozClientCommandReferences;

    // Instance stuff
    [XmlAttribute("Timestamp")]
    public DateTime Timestamp
    {
      get { return _Timestamp; }
      
      set { _Timestamp = value; }

    } private DateTime _Timestamp;

    [XmlElement("TargetWozObjects")]
    public List<SketchObject> TargetWozObjects
    {
      get
      {
        return _TargetWozObjects;
      }
      set
      {
        _TargetWozObjects = new List<SketchObject>(value);
      }
    } private List<SketchObject> _TargetWozObjects;

    public SketchCommand()
    {
      _Timestamp = DateTime.Now;
    }

    public SketchCommand(SketchObject wozObject)
    {
      _Timestamp = DateTime.Now;
      _TargetWozObjects = new List<SketchObject>();
      _TargetWozObjects.Add(wozObject);
    }

    public SketchCommand(IEnumerable<SketchObject> wozObjects)
    {
      _Timestamp = DateTime.Now;
      _TargetWozObjects = new List<SketchObject>(wozObjects);
    }

    public virtual void Undo()
    {
      // nothing really to do here
    }

    public virtual void Redo()
    {
      // nothing really to do here
    }
  }
}
